<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>自定义弹框</title>
    <script src="./alert/jquery-1.8.1.js"></script>
    <script src="./alert/alert.min.js"></script>
    <style>
      .btn-box {
        width: 800px;
        margin: 80px auto;
      }
    </style>
  </head>

  <body>
    <div class="btn-box">
      <button class="alert">提示框</button>
      <button class="confirm">确认框</button>
    </div>
    <script>
      $('.alert').on('click', function () {
        $.alert('成功');
      });
      $('.confirm').on('click', function () {
        $.confirm('是否确认？', function (isConfirm) {
          if (isConfirm) {
            $.alert('确认');
          } else {
            $.alert('取消');
          }
        });
      });
    </script>
  </body>
</html>
